package gui.navigation;

import gui.MyFrame;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class D3Gui extends JPanel{
	
	public D3Gui(final MyFrame myFrame){
		this.setLayout(new GridLayout(5, 1));
		this.setPreferredSize(new Dimension(200, 300));
		JButton polyhedron = new JButton("Polyhedron");
		polyhedron.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.POLYHEDRON);
			}
		});
		this.add(polyhedron);
		
		JButton pyramid = new JButton("Pyramid");
		pyramid.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.PYRAMID);
			}
		});
		this.add(pyramid);
		JButton sphere = new JButton("Sphere");
		sphere.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.SPHERE);
			}
		});
		this.add(sphere);
		JButton dist3D = new JButton("<html><center>Distance between 2 points in 3D space</center></html>");
		dist3D.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setDataPanel(MyFrame.DIST3D);
			}
		});
		this.add(dist3D);
		JButton back = new JButton("Back");
		back.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				myFrame.setNavigationPanel(MyFrame.MAIN);
			}
		});
		this.add(back);
	}
}
